package com.github.prontera.domain.enums;

import com.github.prontera.common.mybatis.handler.CodeEnum;

public enum ConsumeLevelTypeEnum implements CodeEnum<ConsumeLevelTypeEnum> {

	INCOME(0, "收入"), DEPOSIT(1, "押金"), BALANCE(2, "余额"),BEAN(3, "唐豆豆"),DIRECT_CONSUME (4, "微信/支付宝"),WITHDRAWALS(5,"提现"),DIAMOND(6,"唐钻");

	private int code;
	private String desc;

	private ConsumeLevelTypeEnum(int code, String desc) {
		this.code = code;
		this.desc = desc;
	}

	/**
     * 通过枚举<code>name</code>获取枚举
     */
    public static ConsumeLevelTypeEnum getEnumByCode(Integer code) {
    	if(code==null){
    		return null;
    	}
        for (ConsumeLevelTypeEnum enumm : ConsumeLevelTypeEnum.values()) {
            if (enumm.getCode()==code.intValue()) {
                return enumm;
            }
        }
        return null;
    }
    
	@Override
	public int getCode() {
		return code;
	}

	public String getDesc() {
		return desc;
	}
	
}
